//
//  MyCollectionSmallVideoCell.m
//  OnionHome
//
//  Created by fengjie on 2019/9/27.
//  Copyright © 2019 FengJie. All rights reserved.
//

#import "MyCollectionSmallVideoCell.h"

@interface MyCollectionSmallVideoCell ()
/**视频图片*/
@property (nonatomic,strong)UIImageView * IMGView;
/**点赞按钮*/
@property (nonatomic,strong)UIButton * zanBtn;
/**点赞数量*/
@property (nonatomic,strong)UILabel * rightLabel;

@end

@implementation MyCollectionSmallVideoCell

-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self createUI];
    }
    return self;
}
-(void)createUI{
    self.IMGView = UIImageView.new;
    self.IMGView.userInteractionEnabled = YES;
    

    [self addSubview:self.IMGView];

    [self.IMGView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(0);
    }];
    
    self.zanBtn = UIButton.new;
    [self.zanBtn setImage:IMAGE_NAMED(@"xiao_video_play") forState:UIControlStateNormal];
    
    self.rightLabel = UILabel.new;
    self.rightLabel.textColor = UIColorFromRGB(0xF5F7F5);
    self.rightLabel.font = BOLDSYSTEMFONT(14);
    self.rightLabel.text = @"14.2万赞";
    
    [self.IMGView addSubview:self.zanBtn];
    [self.IMGView addSubview:self.rightLabel];
    
    [self.zanBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.bottom.mas_equalTo(-16);
    }];
    [self.rightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.zanBtn.mas_right).offset(3);
        make.right.mas_equalTo(-16);
        make.centerY.mas_equalTo(self.zanBtn);
    }];
    

}
-(void)setModel:(PlayModel *)model{
    _model = model;
    [self.IMGView imageViewWithUrl:model.pictureUrl placeholderImage:@"dynamicDefut"];
}
@end
